package com.tensquare.qa;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * Created by WF on 2020/10/20 10:47
 */
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients         //添加feign服务调用功能
@EnableHystrix              //启用hystrix功能
public class QaApplication {
    public static void main(String[] args) {
        SpringApplication.run(QaApplication.class);
    }

    @Bean
    @LoadBalanced           //实现负载均衡功能
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }
}
